home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / getRebuildCurveCommand.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.6 KB  |  77 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Sep 29, 1998
  22. //  Author:         ms
  23. //
  24. //  Description:
  25. //      Take the options from the option box and return the string
  26. //      for rebuild command.
  27. //
  28.  
  29. global proc string getRebuildCurveCommand( int $noObject )
  30. {
  31.     rebuildCurveSetOptionVars( false );
  32.  
  33.     int $doHistory = `constructionHistory -q -tgl`;
  34.     int $rebuildType = `optionVar -q rebuildCurveType`;
  35.     int $replaceOriginal = !`optionVar -q rebuildCurveKeepOriginal`;
  36.     float $globalTol = `optionVar -q positionalTolerance`;
  37.  
  38.     int $crvNumSpans = `optionVar -q rebuildCurveTypeUniformNumSpans`;
  39.     int $crvDegree = `optionVar -q rebuildCurveTypeUniformDegree`;
  40.     int $keepParmRange = `optionVar -q rebuildCurveKeepRange`;
  41.     int $endKnots = `optionVar -q rebuildCurveEndKnots`;
  42.     int $keepControlPoints = `optionVar -q rebuildCurveKeepControlPoints`;
  43.     int $keepEndPts = `optionVar -q rebuildCurveKeepEndPoints`;
  44.     int $keepTan = `optionVar -q rebuildCurveKeepEndTangents`;
  45.     int $crvUseGlobalTol = `optionVar -q rebuildCurveUseGlobalTolerance`;
  46.     float $crvLocalTol = `optionVar -q rebuildCurveLocalTolerance`;
  47.  
  48.     string $cmd = "rebuildCurve" +
  49.         " -ch " + $doHistory + 
  50.         " -rt " + $rebuildType + 
  51.         " -end " + $endKnots +
  52.         " -kr " + $keepParmRange +
  53.         " -kcp " + $keepControlPoints +
  54.         " -kep " + $keepEndPts + 
  55.         " -kt " + $keepTan;
  56.  
  57.     if( $noObject ) {
  58.         $cmd += " -rpo 0 -o 0";
  59.     }
  60.     else {
  61.         $cmd += " -rpo " + $replaceOriginal + " -o 1";
  62.     }
  63.  
  64.     if( $rebuildType == 0 ) {
  65.         $cmd += " -s " + $crvNumSpans + " -d " + $crvDegree;
  66.     }
  67.     if( $crvUseGlobalTol ) {
  68.         $cmd += " -tol " + $globalTol;
  69.     }
  70.     else {
  71.         $cmd += " -tol " + $crvLocalTol;
  72.     }
  73.     $cmd += " ";
  74.  
  75.     return $cmd;
  76. }
  77.